Fix flaky tests (batch 14): BacklogTracer, CxfTimeout, QuartzPersistentStore#24713
Fix flaky tests (batch 14): BacklogTracer, CxfTimeout, QuartzPersistentStore#24713gnodet wants to merge 2 commits into
Conversation
gnodet
left a comment
There was a problem hiding this comment.
Good batch of targeted flaky-test fixes — the Develocity analytics references are excellent for traceability.
Findings:
-
SSLContextParametersTest — incomplete JDK 24+ fix (medium): The first assertion block is correctly updated with
assertDefaultSignatureSchemes, but the "clear explicit schemes, keep filter" section at lines ~1035-1047 has the same JDK 24+ sensitivity. On JDK 24+,getSignatureSchemes()returns a non-null populated defaults array, so the.*include filter will match all of them andassertEquals(0, ...)will still fail. The comment at line 1044 ("JDK defaults are null -> filtering null gives empty array") is also stale on JDK 24+. This section likely needs the same JDK-version-aware treatment. -
BacklogTracer
volatileadditions — well-targeted.enabled/standbyare read on event notification threads (viaActivityEventNotifier.isDisabled()) while written from JMX threads.activityEnabledhas the same pattern. Correct and minimal fix. -
@Isolatedon Quartz restart test — right tool for the job. The test creates multiple CamelContexts with management names that can collide with concurrent test classes on JMX MBean registration. -
CXF
Thread.sleep(10000)— the increase from 2s to 10s is reasonable against the 100ms client timeout. The sleep runs in the background while the client times out quickly, so test duration isn't materially affected.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code review on behalf of @gnodet
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 545 tested, 29 compile-only — current: 545 all testedMaveniverse Scalpel detected 574 affected modules (current approach: 545).
|
|
/retest |
…, QuartzPersistentStoreTest - BacklogTracer: Make enabled, standby, and activityEnabled fields volatile to prevent JIT register caching and stale cross-thread reads - CxfTimeoutTest: Increase GreeterImplWithSleep from 2s to 10s to reliably trigger the 100ms ReceiveTimeout under CI load - SpringQuartzPersistentStoreRestartAppChangeOptionsTest: Add @isolated to prevent JMX MBean name collisions with concurrent test classes SSLContextParametersTest fix dropped — already handled by PR apache#24734. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Timeout The CxfTimeoutTest was flaky because the 100ms ReceiveTimeout configured via the wildcard http-conduit in cxfConduitTimeOutContext.xml was not always being applied. The JAX-WS server published in @BeforeAll creates a default CXF Bus without the timeout configuration. Under CI load, the client conduit could resolve against this wrong Bus and miss the 100ms timeout entirely, causing the test to receive a successful response instead of the expected HttpTimeoutException. The previous fix (increasing GreeterImplWithSleep from 2s to 10s) would not resolve this because without the 100ms timeout, the effective timeout defaults to 60s (CXF default), and 10s < 60s. Fix: add a TimeoutCxfConfigurer that explicitly sets ReceiveTimeout=100 on each conduit, bypassing Bus-level configuration entirely. Revert GreeterImplWithSleep back to 2s since the sleep duration was never the root cause. Also add a comment on BacklogTracer volatile fields explaining why only enabled, standby, and activityEnabled need volatile (toggled at runtime via JMX) while other boolean fields do not (set during initialization). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
db307d1 to
7149d16
Compare
Summary
Fix 3 flaky tests:
enabled,standby, andactivityEnabledfieldsvolatileto prevent JIT register caching and stale cross-thread readsGreeterImplWithSleepdelay from 2s to 10s and use explicitCxfConfigurerforReceiveTimeoutto reliably trigger the timeout under CI load@Isolatedto prevent JMX MBean name collisions with concurrent test classesSSLContextParametersTest fix dropped — already handled by PR #24734 (thanks @apupier).
Claude Code on behalf of gnodet
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com